package com.zx.rabbitmqconsumer.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Service;

/**
 * @author Zx
 * @date 2021/6/1 9:31
 */
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "email.topic.queue", durable = "true", autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange", type = ExchangeTypes.TOPIC),
        key = "*.sms.#"))
@Service
public class TopicSmsConsumer {

    @RabbitHandler
    public void receiveMsg(String message) {
        System.out.println("sms topic 接收到订单: - > " + message);
    }
}

